package com.yiqi.liebang.feature.setting.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import com.suozhang.framework.framework.BaseActivity;
import com.suozhang.framework.utils.AppUtil;
import com.yiqi.liebang.R;
import com.yiqi.liebang.entity.bo.HomeBo;
import com.yiqi.liebang.feature.home.view.BannerWebActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutActivity extends BaseActivity {


    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.tv_app_version)
    TextView mTvAppVersion;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_about;
    }

    @Override
    protected void initInjector() {

    }


    @Override
    public void initView() {

        String text=AppUtil.getAppName(this)+ "V"+AppUtil.getVersionName(this);
        mTvAppVersion.setText(text);

        initToolBar(mToolbar, "关于", true, true);
    }

    @Override
    protected void initData() {
    }


    @OnClick({R.id.tv_about_about, R.id.tv_about_comment, R.id.tv_about_help, R.id.tv_about_website,R.id.tv_about_xieyi})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_about_about:
                startActivity(new Intent(this, AboutEnterActivity.class));
                break;
            case R.id.tv_about_comment:
                break;
            case R.id.tv_about_help:
                startActivity(new Intent(this, UsingHelpActivity.class));
                break;
            case R.id.tv_about_website:
                HomeBo.IndexBannerBean position=new HomeBo.IndexBannerBean();
                position.setTitle("猎帮官网");
                position.setTurnUrl("http://liebangapp.com/");
              Intent  intent=  new Intent(this, BannerWebActivity.class);
                intent.putExtra("banner", position);
              startActivity(intent);
                break;
            case R.id.tv_about_xieyi:
                startActivity(new Intent(this, ServiceAgreementActivity.class));
                break;
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}